package org.tinygroup.channel.protocol.impl;

import java.util.ArrayList;
import java.util.List;

import org.tinygroup.channel.protocol.ProtocolInterface;
import org.tinygroup.channel.protocol.ProtocolListener;
import org.tinygroup.channel.protocol.ProtocolTrans;

public abstract class AbstractProtocolInterface implements
		ProtocolInterface {
	private String id;
	private List<ProtocolListener<?, ?>> listeners = new ArrayList<ProtocolListener<?, ?>>();
	private ProtocolTrans protocolTrans;

	public void setProtocolTrans(ProtocolTrans trans) {
		this.protocolTrans = trans;
	}

	public ProtocolTrans getProtocolTrans() {
		return this.protocolTrans;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public void addProtocolListener(ProtocolListener<?, ?> listener) {
		listeners.add(listener);
	}

	public List<ProtocolListener<?, ?>> getListeners() {
		return listeners;
	}

	public void setListeners(List<ProtocolListener<?, ?>> listeners) {
		this.listeners = listeners;
	}

}
